<!--https://github.com/flash2x/AnnieJS-->
<!DOCTYPE html>
<html lang="en">
<head>
    <title>冬奥大作战</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,user-scalable=no">
    <script src="https://static.jvlihd.cn/wx/yili/game/libs/annieCore.min.js"></script>
    <!--如果有用到annieUI组件类,则需要开启下面的js-->
    <script src="https://static.jvlihd.cn/wx/yili/game/libs/annieUI.min.js"></script>
    <link rel="stylesheet" href="https://static.jvlihd.cn/wx/sijin/zqj/resource/swiper.min.css?v=2">
    <link rel="stylesheet" href="./resource/index.css?V=2fdffsddsdsddfdsasffdfdsasdfd">
    <script>
        window.swfBytes={"home":3739011,"loading":247808};
        // jWeixin.miniProgram.redirectTo({url: '/home/home'})
        window.config = {
            "DOMAINURL":"https://static.jvlihd.cn/wx/yili/game/",
            "debug":false,
            "offset":{x:0,y:7},
            "onPage":"page1",
            "current_game":"skiing",
            "readyPageDurTime":900,
            "failPageDurTime":1000,
            "gameLayerPageDurTime":500,
            "userInfo":{
                "accessToken":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI0Nzc4Njc5IiwiaWF0IjoxNjQzMzgxOTE3LCJzdWIiOiJkc2tqMiIsImlzcyI6ImRza2oxIiwiZXhwIjoxNjQ1OTczOTE3fQ.DhJS5sAzvirMsbtvSFJHxjQYpvmidAzg71SbiwDRFjY",
                "openid":"",
                "token":"",
                "gameNum":1,
                "prizeId":"",
                "prizeUrl":"",
                "userName":"彭飞001",
                "userHeader":"https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKDicf5o1DPnLLEZKcib4bbjpvALuCsVuVnv9CAN4SUqv4lbWZFo02JyaH5URUPJwpfPIjbO4wuhdUg/132?id="+Math.random(),
            },
            "prizeList":[],
            "gameconfig":{
                "gunIsFail":false,
                "gunGameInt":false,
                "gunNum":5,
                "gunScore":0,
                "gunPassScore":3,
                "gun_dian":[],
                "gunGameSpeed":1.5,//靶子移动速度【值越小，难度越大】

                "curlingIsFail":false,
                "curlingGameInt":false,
                "curling_isTouch":false,
                "curlingGoIng":false,
                "curlingNum":5,
                "curlingScore":0,
                "curlingPassScore":2,
                "curlingGameSpeed":0.7,//进度条速度【值越小，难度越大】
                "curlingUserIntY":912,//用户初始化位置

                "skiingIsFail":false,
                "skiingGameIng":false,
                "skiingGameInt":false,
                "skiingTimer":null,
                "skiingTime":30,
                "skiingTimeInt":30,
                "skiingTotalScore":0,
                "skiingScore":0,
                "skiing_step":[1,2,3,4,5],//跳帧
                "skiingSpeed":0,
                "skiingSpeed_min":20,
                "skiingSpeed_max":30,
                "skiingPassScore":600,
                "clickNumTotal":1,//点击总数
                "clickNum":1,//连续点击次数
                "timerNum":0,//用于重复使用计时期
                "dur_time":1000,//连续点击时间间隔
                "red_user_ing":false,
                "user_ing":false
            },
            "_ROTATION":7,
            "jpList":[
                {prizeId:"bdkmnoqstFIKNQVXY069",name:"伊利纯牛奶1箱",start:0,end:40,giftIndex:7,type:0},
                {prizeId:"agopqzABFHJLNRWZ4568",name:"北京2022年冬奥会伊利定制春节款徽章套装",start:40,end:80,giftIndex:4,type:0},
                {prizeId:"befjqstxzACFRSXZ0159",name:"北京2022年冬奥会伊利定制开闭幕式徽章套装",start:80,end:120,giftIndex:3,type:0},
                {prizeId:"beilmpqrwxyCFQRV0356",name:"北京2022年冬奥会吉祥物冰墩墩伊利定制暖手抱枕",start:120,end:160,giftIndex:2,type:0},
                {prizeId:"bcfgjnvxCFGILMRTUY78",name:"北京2022年冬残奥会吉祥物公仔伊利定制纪念套装",start:160,end:200,giftIndex:1,type:0},
                {prizeId:"abdhimosxzABHKLNSVW3",name:"伊利活力商城 169-45元优惠券",start:200,end:240,giftIndex:9,type:1},
                {prizeId:"cdeimxyFGJMQRVXY1359",name:"北京2022年冬奥会伊利定制中国结徽章",start:240,end:280,giftIndex:5,type:0},
                {prizeId:"cdfglrsvxyDLMRTX0359",name:"北京2022年冬奥会运动造型伊利纪念挂件",start:280,end:320,giftIndex:6,type:0},
                {prizeId:"bglqswzABDKLNRTV0259",name:"伊利活力商城100-20优惠券",start:320,end:360,giftIndex:8,type:1},
            ],
            "jpName":"谢谢参与",
            "getGiftIng":false,

        }

        function getQueryVariable(variable)
        {
            var query = window.location.search.substring(1);
            var vars = query.split("&");
            for (var i=0;i<vars.length;i++) {
                var pair = vars[i].split("=");
                if(pair[0] == variable){return pair[1];}
            }
            return(false);
        }


      
    </script>
    <script src="https://static.jvlihd.cn/lib/jquery-3.6.0.min.js"></script>
    <script src="https://static.jvlihd.cn/wx/yili/game/resource/AnniePlus.js?v=2fd"></script>
    <script src="./resource/webApi.js?v=3fsaffdsfdfsdaasfadfdfdssasafsafs2"></script>
    <script src="https://static.jvlihd.cn/wx/yili/game/src/f2xMain.min.js?v=123sffasfagdfadfa3fds"></script>

</head>
<body>
<div class="rulePage" id="rulePage">
    <img src="https://static.jvlihd.cn/wx/yili/game/resource/rulePage.png" alt="">
</div>
<div hidden>
    <audio src="https://static.jvlihd.cn/wx/yili/game/resource/button.mp3" id="btnAudio"></audio>
    <audio src="https://static.jvlihd.cn/wx/yili/game/resource/gun.mp3?v=32" id="gun"></audio>
    <audio src="https://static.jvlihd.cn/wx/yili/game/resource/readygo.mp3" id="readygo"></audio>
    <audio src="https://static.jvlihd.cn/wx/yili/game/resource/ok.mp3" preload="auto"  id="okAudio"></audio>
</div>
<div class="sharePage" style="display: none;"></div>
<div id="gun_score" class="scoreBox">0环</div>
<div id="curling_score" class="scoreBox">0分</div>
<div id="skiing_time" class="scoreBox">30s</div>
<img src="https://static.jvlihd.cn/wx/yili/game/resource/er.png" class="er" id="er1" alt="">
<img src="https://static.jvlihd.cn/wx/yili/game/resource/er.png" class="er" id="er2" alt="">
<div class="inputBox">
    <div id="uName"><input   class="input1"  type="text" placeholder="请输入你的姓名" ></div>
    <div id="uTel"><input  class="input1"   type="text" placeholder="请输入电话号" maxlength="11"></div>
    <div id="uAddress"><input  class="input1"   type="text" placeholder="省/市/县--详细地址" ></div>
    <div id="submite"></div>
</div>

<div id="speedNum">0m/s</div>
<div id="swiperBox1" class="swiperBox">
    <div class="swiper-container">
        <div class="swiper-wrapper" >
        	<div class="swiper-slide" data-game="skiing">
                <img src="https://static.jvlihd.cn/wx/yili/game/resource/game3.png" alt="">
            </div>
            <div class="swiper-slide" data-game="gun">
                <img src="https://static.jvlihd.cn/wx/yili/game/resource/game1.png" alt="">
            </div>
            <div class="swiper-slide" data-game="curling">
                <img src="https://static.jvlihd.cn/wx/yili/game/resource/game2.png" alt="">
            </div>
        </div>
    </div>
</div>

<!--如果不想canvas全屏而是作为html中的一个标签,请设置div的style.width和style.height为实际值如<div id="annieEngine" style="width:320px;height:576px;line-height:0;font-size:0"></div>-->
<div id="annieEngine" style="line-height:0;font-size:0"></div>
<script src="https://static.jvlihd.cn/lib/autoMusic.js"></script>
<script src="https://static.jvlihd.cn/wx/sijin/zqj/resource/swiper.min.js"></script>
<script src="https://jvlihd.cn/www/include/js/layer.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script>



    $(window).on("blur","input",function(){
        setTimeout(function (){
            window.scrollTo(0, 0);
        },50)
    })


 

    var certifySwiper1 = new Swiper('#swiperBox1 .swiper-container', {
        watchSlidesProgress: true,
        slidesPerView: 'auto',
        centeredSlides: true,
        loop: true,
        loopedSlides: 3,
        on: {
            progress: function(progress) {
                for (var i = 0; i < this.slides.length; i++) {
                    var slide = this.slides.eq(i);
                    var slideProgress = this.slides[i].progress;
                    var modify = 0.5;
                    if (Math.abs(slideProgress) > 1) {
                        modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
                    }
                    var translate = slideProgress * modify * 260 + 'px';
                    var scale = 1 - Math.abs(slideProgress) / 3;
                    var  zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
                    slide.transform('translateX(' + translate + ') scale(' + scale + ')');
                    slide.css('zIndex', zIndex);
                    slide.css('opacity', 1);
                    if (Math.abs(slideProgress) > 3) {
                        slide.css('opacity', 0);
                    }
                }
            },
            setTransition: function(transition) {
                for (var i = 0; i < this.slides.length; i++) {
                    var slide = this.slides.eq(i);
                    slide.transition(transition);
                }

            },
            slideChangeTransitionStart:function(){
                if(window.pageRoot && window.pageRoot.btnaud){
                    window.pageRoot.btnaud.play();
                }
            },
            slideChangeTransitionEnd: function(){
                var game = $(".swiper-slide-active").attr("data-game");
                window.config.current_game =game;
            
               
            },
        }

    });




 
    var postdata = {
        url: document.location.href
    };
   
    wx.miniProgram.postMessage({
        data: {
          shareTitle: '伊利云上冬奥等你来战',
          shareCover: 'https://static.jvlihd.cn/wx/yili/game/resource/shareicon.jpg?v=23',
          shareUrl: 'https://yiligame.jvlihd.cn/' // 特殊变量，此值会重置小程序转发的页面路径，可以是H5链接，也可以是小程序路径
        }
    })

    window.bgMusic = new MusicClass("https://static.jvlihd.cn/wx/yili/game/resource/bg.mp3",true);

    $("body").one("touchstart",function() {     
        window.bgMusic.aud.play();
    });



    let statusBeforeHide = true; // 记录页面切换到后台时音乐的播放状态，如果用户进行了音乐关闭操作，则将该状态置为false
    // document.hidden boolean 页面当前是否不可见
    let hiddenProperty = ('hidden' in document) ? 'hidden'
            : ('webkitHidden' in document) ? 'webkitHidden'
                : ('mozHidden' in document) ? 'mozHidden' : null;
    if (hiddenProperty) {
        let visibilityChangeEvent = hiddenProperty.replace(/hidden/i, 'visibilitychange');
        let onVisibilityChange = () => {
            console.log('visibilityChange');
            changePlay();
        };
        document.addEventListener(visibilityChangeEvent, onVisibilityChange);
    } else {
        console.log("This demo requires a browser, such as Google Chrome or Firefox, that supports the Page Visibility API.");
    }

    // 更改音乐播放状态
    function changePlay() {
        if (document[hiddenProperty]) {
            // 页面隐藏
            if (statusBeforeHide) {
                window.bgMusic.aud.pause(); // 伪代码，音乐暂停，但不改变statusBeforeHide
            }
        } else {
            // 页面显示
            if (statusBeforeHide) {
                window.bgMusic.aud.play() // 伪代码，如果statusBeforeHide是true,音乐继续播放
            }
        }
    }


    
  

    function  wxShare(type,score)
    {
        console.log("类型:"+type+"-----分数:"+score)
    }
</script>
<div id="uMeng" hidden=""></div>
</body>
</html>